import os

import pytest

from utils.data_loader import data_loader
from utils.yaml_update import YamlUpdater

if __name__ == '__main__':
    print(data_loader.get("create_user"))
    print(data_loader.get("env_admin").get("base_url"))
    print(data_loader.get("headers"))

    @pytest.mark.parametrize("user", data_loader.get("user_login"))
    def ceshi(self,user):
        print(user)
        username = user[0].get("username")
        print(username)

    # #获取当前文件所在目录
    # current_dir = os.path.dirname(os.path.abspath(__file__))
    # # 构建配置文件路径（相对于当前文件）
    # config_path = os.path.join(current_dir, '..', '..', 'config', 'test_data.yaml')
    # yu = YamlUpdater(config_path)
    # yu.update("headers", "token", "111")

